package com.swagger.controller;

import com.swagger.pojo.Student;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * Create By Awen on 2021/10/1
 *
 * @author Awen
 */
@Api(tags = "Hello Controller服务", description = "HelloController服务测试 description")
public interface HelloControllerImpl {
    @GetMapping("hello")
    @ApiOperation("Hello方法测试")
    String hello();

    @GetMapping
    @ApiOperation("modifyStudentNum 修改学生学号方法测试！ ")
    @ApiImplicitParam(name = "num", value = "学生的学号", required = true, dataType = "String", paramType = "query")
    Student modifyStudentNum(@RequestParam("num") String num);

    @GetMapping("{name}")
    @ApiOperation("修改学生的姓名")
    @ApiImplicitParam(name = "name", value = "学生的姓名", required = true, dataType = "String", paramType = "path")
    Student modifyStudentName(@PathVariable("name") String name);

    @PostMapping
    @ApiOperation("学生对象")
    Student modifyStudent(@RequestBody Student student);

    @PutMapping("{id}")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "学生id", required = true, dataType = "String", paramType = "path"),
            @ApiImplicitParam(name = "name", value = "学生姓名", required = true, dataType = "String", paramType = "query")
    })
    @ApiOperation("根据id修改学生的信息")
    Student mofidyStudentBynNum(@PathVariable("id") String id, @RequestParam("name") String name, @RequestBody Student student);
}
